#ifndef _U_BOOKSDATABASE_H_
#define _U_BOOKSDATABASE_H_
#include <QSqlQuery>
#include <QList>
#include <QString>
#include "ubooksinfo.h"
class QSqlDatabase;
class UBooksDatabase {
public:
	static UBooksDatabase* Instance();
	~UBooksDatabase();
	void addBook(const QString& ISBN, const QString&title, const QString&author, const QString&press, const QString&date, const QString&image);//增
	bool queryBookByIsbn(const QString& ISBN);//查
	QString queryBook(const QString& title, const QString& ISBN, const QString& author); //查询

	bool deleteBook(const QString& ISBN);//删
	void changeBook(const QString& ISBN, const QString& title, const QString& author, const QString& press, const QString& date, const QString& initisbn);//改

private:
	UBooksDatabase();
	UBooksDatabase(const UBooksDatabase&) = delete;//禁用拷贝构造
	UBooksDatabase(UBooksDatabase&&) = delete;//禁用移动构造

	QSqlDatabase& m_BooksDatabase;
};


#endif // !_U_BOOKSDATABASE_

